﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcps.Web
{
    public partial class LeftTree : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
             if (!IsPostBack)
            {
                if (Session["login"]!=null)
                {
                    
                    TreeNode node = new TreeNode();

                    node.Text = "首页";
                    node.NavigateUrl = "WebSend.aspx";
                    node.Target = "frightBottom";
                    TreeNode node_1 = new TreeNode();
                    node_1.Text = "物资供应计划管理";
                    node_1.NavigateUrl = "WebSend.aspx";
                    node_1.Target = "frightBottom";

                    TreeNode node_1_1 = new TreeNode();

                    node_1_1.Text = "采购申请计划录入";
                    node_1_1.NavigateUrl = "WebSend.aspx";
                    node_1_1.Target = "frightBottom";

                    TreeNode node_1_11 = new TreeNode();

                    node_1_11.Text = "采购申请单项录入";
                    node_1_11.NavigateUrl = "WebSend.aspx";
                    node_1_11.Target = "frightBottom";

                    TreeNode node_1_12 = new TreeNode();

                    node_1_12.Text = "采购申请批量导入";
                    node_1_12.NavigateUrl = "WebSend.aspx";
                    node_1_12.Target = "frightBottom";

                    TreeNode node_1_13 = new TreeNode();

                    node_1_13.Text = "维护申请计划";
                    node_1_13.NavigateUrl = "WebSend.aspx";
                    node_1_13.Target = "frightBottom";

                    TreeNode node_1_2 = new TreeNode();
                    node_1_2.Text = "采购订单录入维护";
                    node_1_2.NavigateUrl = "WebSend.aspx";
                    node_1_2.Target = "frightBottom";

                    TreeNode node_1_21 = new TreeNode();
                    node_1_21.Text = "采购订单单项录入";
                    node_1_21.NavigateUrl = "WebSend.aspx";
                    node_1_21.Target = "frightBottom";

                    TreeNode node_1_22 = new TreeNode();
                    node_1_22.Text = "采购订单批量导入";
                    node_1_22.NavigateUrl = "WebSend.aspx";
                    node_1_22.Target = "frightBottom";
                    TreeNode node_1_23 = new TreeNode();
                    node_1_23.Text = "维护物资合同履约台帐计划";
                    node_1_23.NavigateUrl = "WebSend.aspx";
                    node_1_23.Target = "frightBottom";
                    TreeNode node_1_24 = new TreeNode();
                    node_1_24.Text = "物资合同到货完成率统计";
                    node_1_24.NavigateUrl = "WebSend.aspx";
                    node_1_24.Target = "frightBottom";

                    TreeNode node_1_3 = new TreeNode();
                    node_1_3.Text = "物资供应计划输出";
                    node_1_3.NavigateUrl = "WebSend.aspx";
                    node_1_3.Target = "frightBottom";

                    TreeNode node_1_31 = new TreeNode();
                    node_1_31.Text = "项目物资供应计划履约明细表输出";
                    node_1_31.NavigateUrl = "WebSend.aspx";
                    node_1_31.Target = "frightBottom";

                    TreeNode node_1_32 = new TreeNode();
                    node_1_32.Text = "项目物资需求及生产情况月报输出";
                    node_1_32.NavigateUrl = "WebSend.aspx";
                    node_1_32.Target = "frightBottom";
                    TreeNode node_1_33 = new TreeNode();
                    node_1_33.Text = "项目物资供应计划表输出";
                    node_1_33.NavigateUrl = "WebSend.aspx";
                    node_1_33.Target = "frightBottom";
                    TreeNode node_1_34 = new TreeNode();
                    node_1_34.Text = "项目物资供应计划未到货明细表输出";
                    node_1_34.NavigateUrl = "WebSend.aspx";
                    node_1_34.Target = "frightBottom";
                    TreeNode node_1_35 = new TreeNode();
                    node_1_35.Text = "重点物资履约一览表输出";
                    node_1_35.NavigateUrl = "WebSend.aspx";
                    node_1_35.Target = "frightBottom";

                    TreeNode node_2 = new TreeNode();
                    node_2.Text = "产品质量监督管理";
                    node_2.NavigateUrl = "WebSend.aspx";
                    node_2.Target = "frightBottom";

                    TreeNode node_2_1 = new TreeNode();
                    node_2_1.Text = "供应商不良记录录入";
                    node_2_1.NavigateUrl = "WebSend.aspx";
                    node_2_1.Target = "frightBottom";

                    TreeNode node_2_2 = new TreeNode();
                    node_2_2.Text = "供应商不良档案";
                    node_2_2.NavigateUrl = "WebSend.aspx";
                    node_2_2.Target = "frightBottom";

                    TreeNode node_2_3 = new TreeNode();
                    node_2_3.Text = "供应商产品质量监督";
                    node_2_3.NavigateUrl = "WebSend.aspx";
                    node_2_3.Target = "frightBottom";

                    TreeNode node_2_31 = new TreeNode();
                    node_2_31.Text = "物资自行抽检";
                    node_2_31.NavigateUrl = "WebSend.aspx";
                    node_2_31.Target = "frightBottom";

                    TreeNode node_2_32 = new TreeNode();
                    node_2_32.Text = "物资集中抽检";
                    node_2_32.NavigateUrl = "WebSend.aspx";
                    node_2_32.Target = "frightBottom";

                    TreeNode node_2_33 = new TreeNode();
                    node_2_33.Text = "物资驻厂监造";
                    node_2_33.NavigateUrl = "WebSend.aspx";
                    node_2_33.Target = "frightBottom";

                    TreeNode node_2_34 = new TreeNode();
                    node_2_34.Text = "质量控制点见证";
                    node_2_34.NavigateUrl = "WebSend.aspx";
                    node_2_34.Target = "frightBottom";
                    TreeNode node_2_35 = new TreeNode();
                    node_2_35.Text = "专家巡检";
                    node_2_35.NavigateUrl = "WebSend.aspx";
                    node_2_35.Target = "frightBottom";

                    TreeNode node_2_36 = new TreeNode();
                    node_2_36.Text = "抽样检测";
                    node_2_36.NavigateUrl = "WebSend.aspx";
                    node_2_36.Target = "frightBottom";

                    TreeNode node_3 = new TreeNode();
                    node_3.Text = "供应商关系管理";
                    node_3.NavigateUrl = "WebSend.aspx";
                    node_3.Target = "frightBottom";

                    TreeNode node_3_1 = new TreeNode();
                    node_3_1.Text = "供应商档案";
                    node_3_1.NavigateUrl = "WebSend.aspx";
                    node_3_1.Target = "frightBottom";

                    TreeNode node_3_11 = new TreeNode();
                    node_3_11.Text = "供应商信息录入";
                    node_3_11.NavigateUrl = "WebSend.aspx";
                    node_3_11.Target = "frightBottom";

                    TreeNode node_3_12 = new TreeNode();
                    node_3_12.Text = "供应商信息导入";
                    node_3_12.NavigateUrl = "WebSend.aspx";
                    node_3_12.Target = "frightBottom";

                    TreeNode node_3_13 = new TreeNode();
                    node_3_13.Text = "供应商信息查询及输出";
                    node_3_13.NavigateUrl = "WebSend.aspx";
                    node_3_13.Target = "frightBottom";

                    //TreeNode node_3_2 = new TreeNode();
                    //node_3_2.Text = "供应商联系函";
                    //node_3_2.NavigateUrl = "WebSend.aspx";
                    //node_3_2.Target = "frightBottom";

                    //TreeNode node_3_21 = new TreeNode();
                    //node_3_21.Text = "交货期确认函";
                    //node_3_21.NavigateUrl = "WebSend.aspx";
                    //node_3_21.Target = "frightBottom";

                    //TreeNode node_3_22 = new TreeNode();
                    //node_3_22.Text = "催交函";
                    //node_3_22.NavigateUrl = "WebSend.aspx";
                    //node_3_22.Target = "frightBottom";

                    //TreeNode node_3_23 = new TreeNode();
                    //node_3_23.Text = "消缺函";
                    //node_3_23.NavigateUrl = "WebSend.aspx";
                    //node_3_23.Target = "frightBottom";

                    TreeNode node_3_3 = new TreeNode();
                    node_3_3.Text = "供应商绩效评价";
                    node_3_3.NavigateUrl = "WebSend.aspx";
                    node_3_3.Target = "frightBottom";

                    TreeNode node_3_31 = new TreeNode();
                    node_3_31.Text = "产品质量";
                    node_3_31.NavigateUrl = "WebSend.aspx";
                    node_3_31.Target = "frightBottom";

                    TreeNode node_3_32 = new TreeNode();
                    node_3_32.Text = "合同履约";
                    node_3_32.NavigateUrl = "WebSend.aspx";
                    node_3_32.Target = "frightBottom";

                    TreeNode node_3_33 = new TreeNode();
                    node_3_33.Text = "售后服务";
                    node_3_33.NavigateUrl = "WebSend.aspx";
                    node_3_33.Target = "frightBottom";

                    TreeNode node_4 = new TreeNode();
                    node_4.Text = "物资管理信息化、标准化";
                    node_4.NavigateUrl = "WebSend.aspx";
                    node_4.Target = "frightBottom";

                    TreeNode node_4_1 = new TreeNode();
                    node_4_1.Text = "ERP系统在物资集约化管理上的应用";
                    node_4_1.NavigateUrl = "WebSend.aspx";
                    node_4_1.Target = "frightBottom";

                    TreeNode node_4_2 = new TreeNode();
                    node_4_2.Text = "电子商务平台在物资集约化管理上的应用";
                    node_4_2.NavigateUrl = "WebSend.aspx";
                    node_4_2.Target = "frightBottom";

                    TreeNode node_4_3 = new TreeNode();
                    node_4_3.Text = "物资标准化";
                    node_4_3.NavigateUrl = "WebSend.aspx";
                    node_4_3.Target = "frightBottom";

                    TreeNode node_4_31 = new TreeNode();
                    node_4_31.Text = "物料主数据";
                    node_4_31.NavigateUrl = "WebSend.aspx";
                    node_4_31.Target = "frightBottom";

                    TreeNode node_4_32 = new TreeNode();
                    node_4_32.Text = "物资采购标准";
                    node_4_32.NavigateUrl = "WebSend.aspx";
                    node_4_32.Target = "frightBottom";

                    TreeNode node_4_4 = new TreeNode();
                    node_4_4.Text = "物资供应管理规章制度";
                    node_4_4.NavigateUrl = "WebSend.aspx";
                    node_4_4.Target = "frightBottom";

                    TreeNode node_4_41 = new TreeNode();
                    node_4_41.Text = "国网、集团公司文件";
                    node_4_41.NavigateUrl = "WebSend.aspx";
                    node_4_41.Target = "frightBottom";

                    TreeNode node_4_42 = new TreeNode();
                    node_4_42.Text = "供电公司文件";
                    node_4_42.NavigateUrl = "WebSend.aspx";
                    node_4_42.Target = "frightBottom";

                    TreeNode node_4_43 = new TreeNode();
                    node_4_43.Text = "物资公司文件";
                    node_4_43.NavigateUrl = "WebSend.aspx";
                    node_4_43.Target = "frightBottom";

                    TreeNode node_4_5 = new TreeNode();
                    node_4_5.Text = "管理创新";
                    node_4_5.NavigateUrl = "WebSend.aspx";
                    node_4_5.Target = "frightBottom";

                    TreeNode node_4_51 = new TreeNode();
                    node_4_51.Text = "QC管理";
                    node_4_51.NavigateUrl = "WebSend.aspx";
                    node_4_51.Target = "frightBottom";

                    //TreeNode node_5 = new TreeNode();
                    //node_5.Text = "班组管理";
                    //node_5.NavigateUrl = "WebSend.aspx";
                    //node_5.Target = "frightBottom";

                    //TreeNode node_5_1 = new TreeNode();
                    //node_5_1.Text = "基础建设";
                    //node_5_1.NavigateUrl = "WebSend.aspx";
                    //node_5_1.Target = "frightBottom";

                    //TreeNode node_5_2 = new TreeNode();
                    //node_5_2.Text = "安全建设";
                    //node_5_2.NavigateUrl = "WebSend.aspx";
                    //node_5_2.Target = "frightBottom";

                    //TreeNode node_5_3 = new TreeNode();
                    //node_5_3.Text = "技能建设";
                    //node_5_3.NavigateUrl = "WebSend.aspx";
                    //node_5_3.Target = "frightBottom";

                    //TreeNode node_5_4 = new TreeNode();
                    //node_5_4.Text = "创新建设";
                    //node_5_4.NavigateUrl = "WebSend.aspx";
                    //node_5_4.Target = "frightBottom";

                    //TreeNode node_5_5 = new TreeNode();
                    //node_5_5.Text = "民主建设";
                    //node_5_5.NavigateUrl = "WebSend.aspx";
                    //node_5_5.Target = "frightBottom";

                    //TreeNode node_5_6 = new TreeNode();
                    //node_5_6.Text = "思想建设";
                    //node_5_6.NavigateUrl = "WebSend.aspx";
                    //node_5_6.Target = "frightBottom";

                    //TreeNode node_5_7 = new TreeNode();
                    //node_5_7.Text = "文化建设";
                    //node_5_7.NavigateUrl = "WebSend.aspx";
                    //node_5_7.Target = "frightBottom";

                    //TreeNode node_5_8 = new TreeNode();
                    //node_5_8.Text = "队伍建设";
                    //node_5_8.NavigateUrl = "WebSend.aspx";
                    //node_5_8.Target = "frightBottom";

                    TreeNode node_6 = new TreeNode();
                    node_6.Text = "电子公告";
                    node_6.NavigateUrl = "WebSend.aspx";
                    node_6.Target = "frightBottom";

                    TreeNode node1 = new TreeNode();

                    node1.Text = "录入履约计划";
                    node1.NavigateUrl = "../projectinfo/Add.aspx";
                    node1.Target = "frightBottom";


                    TreeNode node5 = new TreeNode();

                    node5.Text = "导入履约计划";
                    node5.NavigateUrl = "../admin/importData.aspx";
                    node5.Target = "frightBottom";

                    TreeNode node4 = new TreeNode();

                    node4.Text = "履约计划列表";
                    node4.NavigateUrl = "../projectinfo/List.aspx";
                    node4.Target = "frightBottom";

                    TreeNode node2 = new TreeNode();

                    node2.Text = "查询履约计划";
                    node2.NavigateUrl = "../admin/search.aspx";
                    node2.Target = "frightBottom";

                    TreeNode node6 = new TreeNode();

                    node6.Text = "录入供应商不良记录";
                    node6.NavigateUrl = "../badinfo/Add.aspx";
                    node6.Target = "frightBottom";


                    TreeNode node7 = new TreeNode();

                    node7.Text = "供应商不良档案记录列表";
                    node7.NavigateUrl = "../badinfo/List.aspx";
                    node7.Target = "frightBottom";

                    TreeNode node8 = new TreeNode();

                    node8.Text = "物资供应计划目录";
                    node8.NavigateUrl = "../supplyplan/List.aspx";
                    node8.Target = "frightBottom";

                    TreeNode node9 = new TreeNode();

                    node9.Text = "供应商记录";
                    node9.NavigateUrl = "../supplierinfo/List.aspx";
                    node9.Target = "frightBottom";
                    

                    TreeNode node3 = new TreeNode();

                    node3.Text = "修改密码";
                    node3.NavigateUrl = "UpdatePass.aspx";
                    node3.Target = "frightBottom";
                    node_1.ChildNodes.Add(node_1_1);
                    node_1_1.ChildNodes.Add(node_1_11);
                    node_1_1.ChildNodes.Add(node_1_12);
                    node_1_1.ChildNodes.Add(node_1_13);
                    node_1.ChildNodes.Add(node_1_2);
                    node_1_2.ChildNodes.Add(node_1_21);
                    node_1_2.ChildNodes.Add(node_1_22);
                    node_1_2.ChildNodes.Add(node_1_23);
                    node_1_2.ChildNodes.Add(node_1_24);
                    node_1.ChildNodes.Add(node_1_3);
                    node_1_3.ChildNodes.Add(node_1_31);
                    node_1_3.ChildNodes.Add(node_1_32);
                    node_1_3.ChildNodes.Add(node_1_33);
                    node_1_3.ChildNodes.Add(node_1_34);
                    node_1_3.ChildNodes.Add(node_1_35);
                    node_2.ChildNodes.Add(node_2_1);
                    node_2.ChildNodes.Add(node_2_2);
                    node_2.ChildNodes.Add(node_2_3);
                    node_2_3.ChildNodes.Add(node_2_31);
                    node_2_3.ChildNodes.Add(node_2_32);
                    node_2_3.ChildNodes.Add(node_2_33);
                    node_2_3.ChildNodes.Add(node_2_34);
                    node_2_3.ChildNodes.Add(node_2_35);
                    node_2_3.ChildNodes.Add(node_2_36);
                    node_3.ChildNodes.Add(node_3_1);
                    node_3_1.ChildNodes.Add(node_3_11);
                    node_3_1.ChildNodes.Add(node_3_12);
                    node_3_1.ChildNodes.Add(node_3_13);
                    //node_3.ChildNodes.Add(node_3_2);
                    //node_3_2.ChildNodes.Add(node_3_21);
                    //node_3_2.ChildNodes.Add(node_3_22);
                    //node_3_2.ChildNodes.Add(node_3_23);
                    node_3.ChildNodes.Add(node_3_3);
                    node_3_3.ChildNodes.Add(node_3_31);
                    node_3_3.ChildNodes.Add(node_3_32);
                    node_3_3.ChildNodes.Add(node_3_33);
                    node_4.ChildNodes.Add(node_4_1);
                    node_4.ChildNodes.Add(node_4_2);
                    node_4.ChildNodes.Add(node_4_3);
                    node_4_3.ChildNodes.Add(node_4_31);
                    node_4_3.ChildNodes.Add(node_4_32);
                    node_4.ChildNodes.Add(node_4_4);
                    node_4_4.ChildNodes.Add(node_4_41);
                    node_4_4.ChildNodes.Add(node_4_42);
                    node_4_4.ChildNodes.Add(node_4_43);
                    node_4.ChildNodes.Add(node_4_5);
                    node_4_5.ChildNodes.Add(node_4_51);
                    //node_5.ChildNodes.Add(node_5_1);
                    //node_5.ChildNodes.Add(node_5_2);
                    //node_5.ChildNodes.Add(node_5_3);
                    //node_5.ChildNodes.Add(node_5_4);
                    //node_5.ChildNodes.Add(node_5_5);
                    //node_5.ChildNodes.Add(node_5_6);
                    //node_5.ChildNodes.Add(node_5_7);
                    //node_5.ChildNodes.Add(node_5_8);
                    

                    this.TreeView1.Nodes.Add(node_1);
                    this.TreeView1.Nodes.Add(node_2);
                    this.TreeView1.Nodes.Add(node_3);
                    this.TreeView1.Nodes.Add(node_4);
                    //this.TreeView1.Nodes.Add(node_5);
                    this.TreeView1.Nodes.Add(node_6);

                    this.TreeView1.Nodes.Add(node1);
                    this.TreeView1.Nodes.Add(node5);
                    //this.TreeView1.Nodes.Add(node4);
                    this.TreeView1.Nodes.Add(node2);
                    this.TreeView1.Nodes.Add(node6);
                    this.TreeView1.Nodes.Add(node7);
                    this.TreeView1.Nodes.Add(node8);
                    this.TreeView1.Nodes.Add(node9);
                    this.TreeView1.Nodes.Add(node3);

                    DataSet ds = Session["login"] as DataSet;

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        string rank = ds.Tables[0].Rows[0]["userrank"].ToString();

                        if (rank == "0")
                        {
                            //如果是管理员则具备新闻编辑权限
                            TreeNode node10 = new TreeNode();

                            node10.Text = "添加文章";
                            node10.NavigateUrl = "../article/Add.aspx";
                            node10.Target = "frightBottom";

                            TreeNode node11 = new TreeNode();

                            node11.Text = "文章管理";
                            node11.NavigateUrl = "../article/List.aspx";
                            node11.Target = "frightBottom";


                            this.TreeView1.Nodes.Add(node10);
                            this.TreeView1.Nodes.Add(node11);

                        }

                    }

                    
        
                   
                }
                
            }
        

        }
    }
}